<template>
	<view>
		组件
	</view>
</template>

<script setup name="Arithmetic">
	import {addition,subtraction,multiplication,ndivision} from '@/util/arithmetic.js'
	import {setStore} from '@/util/storageSync.js'
	let {num1,num2,id} = defineProps({
		num1:{
			type:Number,
			default:0
		},
		num2:{
			type:Number,
			default:0
		},
		id:{
			type:String
		}
	})
	
	if(id===3){
		let reslut = addition(num1,num2)
		let reslut1 = subtraction(num1,num2)
		let reslut2 = multiplication(num1,num2)
		let reslut3 = ndivision(num1,num2)
		setStore(`页面${id}`,[reslut,reslut1,reslut2,reslut3])
	}
	if(id===2){
		let reslut = addition(num1,num2)
		let reslut1 = subtraction(num1,num2)
		let reslut2 = multiplication(num1,num2)
		let reslut3 = ndivision(num1,num2)
		setStore(`页面${id}`,[reslut,reslut1,reslut2,reslut3])
	}
	if(id===1){
		let reslut = addition(num1,num2)
		let reslut1 = subtraction(num1,num2)
		let reslut2 = multiplication(num1,num2)
		let reslut3 = ndivision(num1,num2)
		setStore(`页面${id}`,[reslut,reslut1,reslut2,reslut3])
	}
	
	
</script>

<style>

</style>